import http from '.'

export function queryPowerList(params) {
  return http.get('api/v1/power/query?' + Form(params).queryString())
}

export function deletePower(rowId) {
  return http.post('api/v1/power/delete?rowId=' + rowId)
}

export function queryPowerDetail(rowId) {
  return http.get('api/v1/power/detail?rowId=' + rowId)
}

export function savePowerDetail(params) {
  return http.post('api/v1/power/edit', Form(params))
}

export function addPower(params) {
  return http.post('api/v1/power/add', Form(params))
}

export function powerCommand(params) {
  return http.post('api/v1/power/powerCommand', Form(params))
}
/**
 *小区门
 */
export function selectCommunityDoorByDevicePlan() {
  return http.get('api/v1/doorCommunity/selectCommunityDoorByDevicePlan')
}
/**
 * 单元门
 */
export function selectUnitDoorByDevicePlan() {
  return http.get('api/v1/doorUnit/selectUnitDoorByDevicePlan')
}

/**
 * 特殊门
 */
export function selectDoorHouseByDevicePlan() {
  return http.get('api/v1/doorHouse/selectDoorHouseByDevicePlan')
}
/**
 * 查询电源电源设备安装计划列表
 * @param {*} params
 */
export function queryPowerPlanList(params) {
  return http.get(
    'api/v1/power/mdPowerInstallStaringPlan/query?' + Form(params).queryString()
  )
}
/**
 * 新增电源设备安装计划
 * @param {*} params
 */
export function addPowerPlan(params) {
  return http.post(
    `api/v1/power/mdPowerInstallStaringPlan/${params.rowId ? 'edit' : 'add'}`,
    Form(params)
  )
}
/**
 * 删除电源设备安装计划
 * @param {*} rowId
 */
export function deletePowerPlan(rowId) {
  return http.post(
    'api/v1/power/mdPowerInstallStaringPlan/delete?rowId=' + rowId
  )
}
/**
 * 查询电源设备库存列表
 * @param {*} params
 */
export function queryPowerStock(params) {
  return http.get('api/v1/power/mdPowerStock/query?' + Form(params))
}
/**
 * 获取电源设备批次
 */
export function queryPowerStockBatch() {
  return http.get('api/v1/power/mdPowerStock/queryPowerStockBatch')
}
/**
 * 新增电源设备批次
 * @param {*} params
 */
export function addPowerStockBatch(params) {
  return http.post(
    `api/v1/power/mdPowerStock/${params.rowId ? 'edit' : 'addMdPowerStock'}`,
    Form(params)
  )
}
/**
 * 删除电源设备批次
 * @param {*} rowId
 */
export function deletePowerStockBatch(rowId) {
  return http.post('api/v1/power/mdPowerStock/delete?rowId=' + rowId)
}
/**
 * 导入excel
 */
export function uploadFile(excle) {
  return http.post('api/v1/power/mdPowerStock/insertBatch', excle)
}
/**
 * 导入电源设备编号
 */
export function queryPowerStockNum() {
  return http.get('api/v1/power/mdPowerInstallStaringPlan/queryPowerStockNum')
}
